gem 'delayed_job_active_record'

bundle

rails generate delayed_job:active_record
rake db:migrate

config.active_job.queue_adapter = :delayed_job

Here is an example of changing job parameters in Rails:

1
2
3
4
5
6
7
8
9
10
# config/initializers/delayed_job_config.rb
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 60
Delayed::Worker.max_attempts = 3
Delayed::Worker.max_run_time = 5.minutes
Delayed::Worker.read_ahead = 10
Delayed::Worker.default_queue_name = 'default'
Delayed::Worker.delay_jobs = !Rails.env.test?
Delayed::Worker.raise_signal_exceptions = :term
Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))

RAILS_ENV=production bin/delayed_job start